home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FM Towns: Free Software Collection 4
/
FM Towns Free Software Collection 4 - Disc 1.iso
/
t_os
/
magrex
/
tate.asm
< prev
next >
Wrap
Assembly Source File
|
1991-10-18
|
2KB
|
161 lines
; tate.asm 91.03.30
; copyright(c)1991 K.Kurosaki
.386p
p_get macro x,y
mov ebx,y
mov edx,x
call p_get00
endm
p_put macro x,y
mov ebx,y
mov edx,x
call p_put00
endm
code segment dword public ER use32 'CODE'
assume cs:CODE,ds:CODE
tate proc near
mov ebp,esp
mov eax,[ebp+4] ; 第一パラメータ x
add eax,[ebp+12] ;
cmp eax,1024
jae tate30
mov eax,[ebp+8] ; 第二パラメータ y
add eax,[ebp+12] ;
cmp eax,512
jae tate30
mov ax,1ch
mov es,ax
mov eax,[ebp+4]
mov c_ix,eax
add eax,[ebp+12]
mov c_nix,eax
mov eax,[ebp+8]
mov c_iy,eax
add eax,[ebp+12]
mov c_niy,eax
mov ecx,[ebp+12]
shr ecx,1
mov edi,[ebp+12]
tate10:
push ecx
mov eax,c_ix
mov c_jx,eax
mov eax,c_iy
mov c_jy,eax
mov eax,c_nix
mov c_njx,eax
mov eax,c_niy
mov c_njy,eax
mov ecx,edi
tate20:
call tate_sub
loop tate20
inc c_ix
inc c_iy
dec c_nix
dec c_niy
dec edi
dec edi
pop ecx
loop tate10
tate30:
ret
tate endp
tate_sub proc near
mov esi,offset p_buf
p_get c_njx,c_iy ; p1
p_get c_ix ,c_jy ; p2
p_get c_jx ,c_niy ; p3
p_get c_nix,c_njy ; p4
p_put c_njx,c_iy ; p4
p_put c_nix,c_njy ; p3
p_put c_jx ,c_niy ; p2
p_put c_ix ,c_jy ; p1
inc c_jx
inc c_jy
dec c_njx
dec c_njy
ret
tate_sub endp
p_get00 proc near
shl ebx,9
shr edx,1
jc p_get10
add ebx,edx
mov al,es:[ebx]
and al,0fh
mov [esi],al
inc esi
ret
p_get10:
add ebx,edx
mov al,es:[ebx]
shr al,4
mov [esi],al
inc esi
ret
p_get00 endp
p_put00 proc near
dec esi
mov al,[esi]
shl ebx,9
shr edx,1
jc p_put10
add ebx,edx
mov ah,es:[ebx]
and ah,0f0h
or al,ah
mov es:[ebx],al
ret
p_put10:
add ebx,edx
mov ah,es:[ebx]
and ah,0fh
shl al,4
or al,ah
mov es:[ebx],al
ret
p_put00 endp
c_ix dd ?
c_iy dd ?
c_nix dd ?
c_niy dd ?
c_jx dd ?
c_jy dd ?
c_njx dd ?
c_njy dd ?
p_buf db 4 dup(?)
CODE ends
end